﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddOrEdit.aspx.cs" Inherits="admin_Modules_NewsEvent_Links_AddOrEdit" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script src="/admin/resources/js/base.js" type="text/javascript"></script>
    <script src="/plugins/ckeditor/ckeditor.js" type="text/javascript"></script>
    <script src="/plugins/ckfinder/ckfinder.js" type="text/javascript"></script>
    <script src="/plugins/ckfinder/config.js" type="text/javascript"></script>
    <script language="javascript">
        function BrowseServer() {
            // You can use the "CKFinder" class to render CKFinder in a page:
            var finder = new CKFinder();
            finder.basePath = '/plugins/ckfinder/'; // The path for the installation of CKFinder (default = "/ckfinder/").
            finder.selectActionFunction = SetFileField;
            finder.popup();
        }


        // This is a sample function which is called when a file is selected in CKFinder.
        function SetFileField(fileUrl) {
            triggerAttachImage.setValue(fileUrl);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ScriptManager2" runat="server">
    </ext:ResourceManager>
    <ext:Viewport ID="wdAddOrEditImageCategory" runat="server" Layout="BorderLayout">
        <Items>
            <ext:Panel Region="Center" BodyStyle="backgound-color:#fff;" BodyBorder="true" Layout="Fit">
                <TopBar>
                    <ext:Toolbar ID="Toolbar2" runat="server">
                        <Items>
                            <ext:Button Icon="Disk" Text="Cập nhật">
                                <DirectEvents>
                                    <Click Success="closeWindow();" OnEvent="AddOrEdit" Before="valid = #{StatusForm2}.getForm().isValid(); if(valid){ Ext.Msg.wait('Đang cập nhật dữ liêu...', 'Saving'); } return valid;">
                                    </Click>
                                </DirectEvents>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Items>
                    <ext:FormPanel ID="StatusForm2" BodyBorder="false" Header="false" runat="server"
                        LabelWidth="120" BodyStyle="padding:5px">
                        <Items>
                            <ext:FormLayout>
                                <Anchors>
                                    <ext:Anchor Horizontal="95%">
                                        <ext:TextField runat="server" ID="txtTitle" Width="540" FieldLabel="Tên" AllowBlank="false">
                                        </ext:TextField>
                                    </ext:Anchor>
                                    <ext:Anchor Horizontal="95%">
                                        <ext:TextField runat="server" ID="txtUrl" Width="540" FieldLabel="Liên kết" Note="Liên kết dạng đầy đủ, ví dụ: http://wakeup.vn">
                                        </ext:TextField>
                                    </ext:Anchor>
                                    <ext:Anchor Horizontal="95%">
                                        <ext:NumberField ID="txtImageDetailOrder" Text="0" runat="server" FieldLabel="Thứ tự"
                                            EmptyText="Thứ tự">
                                        </ext:NumberField>
                                    </ext:Anchor>
                                    <ext:Anchor Horizontal="95%">
                                        <ext:TriggerField ID="triggerAttachImage" FieldLabel="Ảnh tỏm tắt" runat="server"
                                            EmptyText="Ảnh tóm tắt" AllowBlank="true" Editable="false">
                                            <Listeners>
                                                <TriggerClick Handler="BrowseServer();" />
                                                <Focus Handler="BrowseServer();" />
                                            </Listeners>
                                            <Triggers>
                                                <ext:FieldTrigger Icon="Ellipsis" />
                                            </Triggers>
                                        </ext:TriggerField>
                                    </ext:Anchor>
                                    <ext:Anchor Horizontal="95%">
                                        <ext:Checkbox runat="server" ID="chkPublish" Checked="true" FieldLabel="Thể hiện">
                                        </ext:Checkbox>
                                    </ext:Anchor>
                                </Anchors>
                            </ext:FormLayout>
                        </Items>
                    </ext:FormPanel>
                </Items>
            </ext:Panel>
        </Items>
    </ext:Viewport>
    </form>
</body>
</html>
